package com.springboot.idempotence.redis.exception;

/**
 * 错误信息
 */
public class TokenException extends Exception {
    private int code;

    public enum ResponseCode {
        ILLEGAL_ARGUMENT("非法Token"), REPETITIVE_OPERATION("重复操作");
        private String msg;

        ResponseCode(String msg) {
            this.msg = msg;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }
    }

    public TokenException(ResponseCode message, int code) {
        super(message.getMsg());
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
